package com.ruix.app.network.okhttp;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import org.json.JSONObject;

import java.io.IOException;
import java.util.Map;

/**
 * Created by hadexs on 2017/4/12.
 */

public class PostFormRequest extends BaseRequest {


    // 执行请求－数据源－JsonObj
    public static Response execute(OkHttpClient client, String url, JSONObject formContent) throws IOException {
        Request request = getPostFormRequest(url, formContent);
        return execute(client, request);// 执行在调用者线程
    }

    // 执行请求－数据源及文件－JsonObj
    public static Response execute(OkHttpClient client, String url, JSONObject formContent, Map<String, String> files, String mediaType) throws IOException {
        Request request = getPostFormRequest(url, formContent, files, mediaType);
        return execute(client, request);// 执行在调用者线程
    }

}
